function Queue(){
    this.dataStore=[];
    this.enqueue=enqueue;
    this.dequeue=dequeue;
    this.front=front;
    this.back=back;
    this.toString=toString;
    this.empty=empty;
}

//入队
function enqueue(ele){
    this.dataStore.push(ele);
}

//出队,就是丛书前面删除元素
function dequeue(){
    return this.dataStore.shift();
}

//读取队首和队尾
function front(){
    return this.dataStore[0];
}

function back(){
    return this.dataStore[this.dataStore.length-1];
}

//显示队列里面所有的元素
function toString(){
    var reStr="";
    for(var i=0;i<this.dataStore.length;++i){
        reStr+=this.dataStore[i]+"\n";
    }
    return reStr;
}

//判断队列是否为空
function empty(){
    if(this.dataStore.length===0){
        return true;
    }else{
        return false;
    }
}